// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Vue from 'vue'
import App from './App'
import Api from './api';
import config from './config';
import router from './router'
import global from './components/Global.vue'
import {setCookie, getCookie, delCookie} from './assets/cookie/cookie.js'
Vue.prototype.$windowsWidth = global.setWindowsWidth();
Vue.prototype.$windowsHeight = global.setWindowsHeight();

Vue.use(ElementUI);
Vue.use(Api);
Vue.config.productionTip = false;

Vue.prototype.setDynamicHeight = function (proportion){
  const style = {};
  style.height = (Vue.prototype.$windowsHeight * proportion) + "px";
  return style;
};

Vue.prototype.getProportionHeight = function (proportion){
  return Vue.prototype.$windowsHeight * proportion;
};

Vue.prototype.getProportionWidth = function (proportion){
  return Vue.prototype.$windowsWidth * proportion;
};

Vue.prototype.config = config;

Vue.prototype.$cookieStore = {
  setCookie,
  getCookie,
  delCookie
};

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
